/*
 * @Description: 站点下线路
 * @Author: buwei.huang
 * @Date: 2019-05-30 10:08:01
 * @Last Modified by: buwei.huang
 * @Last Modified time: 2019-06-12 13:56:21
 */

<template>
  <div
    id="app"
    class="station_details_main"
  >
    <!-- 头部 -->
    <station-header
      :busInfo="busInfo"
      :GPSinfo="GPSinfo"
    />
    <!-- 列表 -->
    <station-list :busInfo="busInfo" />
  </div>
</template>

<script>
import { Header, StationList } from './components'
import { getUrlParams } from 'vue-xiaobu-utils'
import { getCurrentPosition } from '@/utils/LocationUtils.js'
export default {
  name: 'App',
  components: {
    'station-header': Header,
    'station-list': StationList
  },
  data() {
    return {
      busInfo: {},
      GPSinfo: {}
    }
  },
  created() {
    let params = getUrlParams()
    this.busInfo = params
  },
  mounted() {
    // 获取GPS定位
    getCurrentPosition(this).then(res => {
      this.GPSinfo = { ...res }
    }).catch(error => {
      console.log(error)
    })
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  background-color: #f2f5f6;
}
/* 修复css边距合并带来的问题 */
body {
  position: absolute;
  width: 100%;
}
#app {
  height: 100%;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
/* 包裹层 */
.station_details_main {
}
</style>
